package com.bear.cmcc.NetTestHTTP.ui.adapter;

import com.bear.cmcc.NetTestHTTP.R;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

public class TimeAdapter extends BaseAdapter {
	private LayoutInflater layoutInflater;
	private String[] list;

	public TimeAdapter(Context context, String[] list) {
		this.list = list;
		layoutInflater = LayoutInflater.from(context);
	}

	@Override
	public int getCount() {
		return list.length;
	}

	@Override
	public Object getItem(int position) {
		return list[position];
	}

	@Override
	public long getItemId(int position) {
		return position;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		View layout = layoutInflater.inflate(R.layout.item_time, parent, false);

		TextView tv = (TextView) layout.findViewById(R.id.tvColorSet);
		tv.setText(list[position]);
		return layout;
	}

}